#pragma once
#include <cocos2d.h>
#include <iostream>

using namespace std;

USING_NS_CC;

class SpriteAnimation : public CCNode
{
public:
	SpriteAnimation(void);
	~SpriteAnimation(void);

	bool initWith(string textureFileName, string plistFileName, string prefix, int begin, int end);
	static SpriteAnimation* createWith(string textureFileName, string plistFileName, string prefix, int begin, int end);
	void playAnimation(bool isLoop);
	void stopAnimation();
	bool isDone();
	void setOpacity(int a);


	CC_SYNTHESIZE(float, _timeStep, TimeStep);
	CC_SYNTHESIZE_RETAIN(CCArray*, _animationFrames, AnimationFrames);
	CC_SYNTHESIZE_RETAIN(CCSprite*, _sprite, Sprite);
	CC_SYNTHESIZE_RETAIN(CCSpriteBatchNode*, _spriteBatchNode, SpriteBatchNode);
};

